<?php 

	$post_data = array(
	    'filename' => '@'.$_FILES["file2"]["tmp_name"],
	    'parent_id' => 0,
	  	);	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, 'https://api.box.com/2.0/files/content');
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: Bearer ".$_POST['access_token']));
	curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
	$tmp = curl_exec($ch);
	
	$result = json_decode($tmp); 
	
	header("Location: index.php");
?>